


        Vue.component('v-header',{
            template:`<header>
            <div class="fluid">
                <div class="heading">
                    <div class="left flex flex-align-items">
                        <a href="index.html"><img :src='webBasicInf.logoImg'></a>
                        <p class="tip">让天下创业更容易</p>
                    </div>
                    <div class="rht">
                      <div class="search flex">
                          <img src="img/common/search.png">
                          <input type="text" class="inp" placeholder="请输入关键词搜索">
                          <p class="submit">搜索</p>
                      </div>
                      <p class="keywords">
                          <span>公司注册</span>
                          <span>公司变更</span>
                          <span>代理记账</span>
                          <span>税收筹划</span>
                          <span>资质认证</span>
                      </p>
                    </div>
                    
                </div>
                <nav class="flex">
                    <p class="menuBtn cursor flex flex-align-items btn"><img src="./img/common/mb.png">全部业务</p>
                    <div class="links">
                        <div :class='["itm",currentLinkInd == i?"active":""]' v-for="(item,i) in nav">
                            <a :href="item.visitUrl">{{item.name}}</a>
                        </div>
                    </div>
                    <p class="cell">{{webBasicInf.tel}}</p>
                </nav>
            </div>
        </header>`,
            data:function(){
                return{
                  webBasicInf:{},
                  nav:[],
                  currentLinkInd:''
                }
            },
            created:function(){
              //获取网站基本信息
              axios.get(dataUrl + 'api/getWebsite',{
                headers:{
                  Authorization: headers
                }
              })
              .then((res) => {
                //console.log(res.data.data);
                this.webBasicInf = res.data.data;
              })
              //获取导航栏
              axios.get(dataUrl + 'api/getNavbar',{
                headers:{
                  Authorization: headers
                }
              })
              .then((res) => {
                //console.log(res.data.data);
                this.nav = res.data.data;
                for(var a = 0;a < this.nav.length;a++){
                  if(window.location.href.indexOf(this.nav[a].visitUrl) >= 0){
                    this.currentLinkInd = a;
                    break;
                  }
                }
                setTimeout(function(){

                },10)
              });
            }
        });